package com.guldan.thrall.common.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Silas.
 * Date: 2016/10/1
 * Time: 22:41
 */
public class BaseController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    private static Map<String, String> loginUser;

    static {
        loginUser = new HashMap<String, String>();
    }

    public static boolean authLogin(String username, String password, String JSESSIONID) {
        if (password.equals("123456")) {
            if (loginUser.containsKey(username))
                loginUser.replace(username, JSESSIONID);
            else
                loginUser.put(username, JSESSIONID);
        }
        return true;
    }
}
